<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">

<head>
    {% block head %}

    <meta name="author" content="{% block meta_author %}{% endblock %}" />
    <meta name="description" content="{% block meta_description %}{% endblock %}" />
    <meta name="keywords" content="{% block meta_keywords %}{% endblock %}" />
    <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
    <meta charset="utf-8" />
    <meta name="generator" content="Pelican {{ PELICAN_VERSION }}">

    <link rel="stylesheet" id="responsive-style-css"  href="{{ SiteProtoDomainTLD }}/theme/css/main.css" type="text/css" media="all" />

    <link rel="shortcut icon" type="image/x-icon" href='{{ SiteProtoDomainTLD }}/favicon.ico' />
    {% if FEED_ALL_ATOM %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
    {% endif %}
    {% if FEED_ALL_RSS %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
    {% endif %}
    {% if FEED_ATOM %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
    {% endif %}
    {% if FEED_RSS %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
    {% endif %}
    {% if CATEGORY_FEED_ATOM and category %}
    <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
    {% endif %}
    {% if CATEGORY_FEED_RSS and category %}
    <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
    {% endif %}
    {% if TAG_FEED_ATOM and tag %}
    <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
    {% endif %}
    {% if TAG_FEED_RSS and tag %}
    <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
    {% endif %}

    {% endblock head %}
</head>

<body>

<header title="First view with nav and either a big picture or a bar.">

    <nav>
        <ul>
        {% for title, link in MENUITEMS %}
            <li{% if page == pagePrime %} class="active"{% endif %}><a href="{{ link }}">{{ title }}</a></li>
        {% endfor %}
        {% if DISPLAY_PAGES_ON_MENU %}
          {% for page in pages %}
            {% if page.title == "Home" %}
            <!--TODO: Change this to the offset to the root instead of the absolute root. -->
            <li>
                <a href="/">
                    <img src="/logo.svg" alt="{{SITENAME}} Logo" class="logo">
                </a>
            </li>
            {% else %}
            <li{% if page == pagePrime %} class="active"{% endif %}><a href="{{ SiteProtoDomainTLD }}/{{ page.url }}">{{ page.title }}</a></li>
            {% endif %}
          {% endfor %}
        {% else %}
          {% if DISPLAY_CATEGORIES_ON_MENU %}
            {% for cat, null in categories %}
            <li{% if cat == category %} class="active"{% endif %}><a href="{{ SiteProtoDomainTLD }}/{{ cat.url }}">{{ cat }}</a></li>
            {% endfor %}
          {% endif %}
        {% endif %}
        </ul>

        <ul>
            <li><a href="#sitemap">Sitemap</a></li>
        </ul>
    </nav>

</header>

{% block content %}
{% endblock %}

{% block widgets %}
<section title="Widgets and Sitemap" class="widgets">

<!--NOTE: Some templates put a block searchform here.-->
    <a id="sitemap"></a>
    <div class="widget">
        <h1>Pages</h1>
        <ul>
            {% for page in pages %}
                <li><a href="{{ SiteProtoDomainTLD }}/{{ page.url }}">{{ page.title }}</a></li>
            {% endfor %}
        </ul>
    </div>

    {% block categories %}
    {% if categories %}
    <div class="widget">
        <h1>Category</h1>
        <ul>
            {% for category, article in categories%}
                <li><a href="{{ SiteProtoDomainTLD }}/{{ category.url }}" >{{ category.name }} </a></li>
            {% endfor %}
        </ul>
    </div>
    {% endif %}
    {% endblock %}

    {% block tagcloud %}
    {% if tags %}
    <div class="widget">
        <h1>Tags</h1>
        <div class="tags-max-width">
            {% for tag, articles in tags %}
                <span><a href="{{ SiteProtoDomainTLD }}/{{ tag.url }}">{{ tag.name }}</a></span>
            {% endfor %}
        </div>
    </div>
    {% endif %}
    {% endblock %}

    {% block links %}
    {% if LINKS %}
    <div class="widget">
        <h1>Links</h1>
        <ul>
            {% for name, link in LINKS %}
            <li><a href="{{ link }}">{{ name }}</a></li>
            {% endfor %}
            {% for name, link in SOCIAL %}
            <li><a href="{{ link }}">{{ name }}</a></li>
            {% endfor %}
        </ul>
    </div>
    {% endif %}
    {% endblock %}

</section>
{% endblock widgets %}


<!--NOTE: Some templates put a block footer here.-->


</body>
</html>
